<template>
    <div>
        <Row :gutter="10">
            <i-col :xs="12" :md="6" :lg="6" style="height: 120px;padding-bottom: 10px;">
                <infor-card shadow color="#2d8cf0" icon="ios-brush-outline" :icon-size="36" @click.native="applyMaterial">
                    <p style="color:red;font-size: 30px;font-weight: bold">申请转正</p>
                </infor-card>
                <img src="../../assets/ok.png" v-if="user.hasMember === '1'" alt=""  style="position: absolute;top: -18px;left: 400px">
            </i-col>
            <i-col :xs="12" :md="6" :lg="6" style="height: 120px;padding-bottom: 10px;">
                <infor-card shadow color="#19be6b" icon="md-locate" :icon-size="36">
                    <p style="color:red;font-size: 30px;font-weight: bold">2 %</p>
                    <p>合格占比(成绩<90分且>=60分)</p>
                </infor-card>
                <img src="../../assets/no.png" alt=""  style="position: absolute;top: -18px;left: 400px">
            </i-col>
            <i-col :xs="12" :md="6" :lg="6" style="height: 120px;padding-bottom: 10px;">
                <infor-card shadow color="#ff9900" icon="md-help-circle" :icon-size="36">
                    <p style="color:red;font-size: 30px;font-weight: bold">3 %</p>
                    <p>不合格占比(成绩<60分)</p>
                </infor-card>
            </i-col>
            <i-col :xs="12" :md="6" :lg="6" style="height: 120px;padding-bottom: 10px;">
                <infor-card shadow color="#ed3f14" icon="md-share" :icon-size="36">
                    <p style="color:red;font-size: 30px;font-weight: bold">4 %</p>
                    <p>未参考占比</p>
                </infor-card>
            </i-col>
        </Row>

        <each-general-child ref="eachGeneralChild"></each-general-child>

    </div>
</template>

<script>

    import { searchTeacherBySelf } from '@/api/principal/school-manager/teacher'

    export default {
        name: "each-general",
        components:{
            InforCard:()=>import('@/components/info-card/infor-card.vue'),
            EachGeneralChild:()=>import("@/views/work/each-general-child.vue")
        },
        data(){
            return {
                user:{}
            }
        },
        methods:{
            applyMaterial(){

                if(this.user.level === 'saasAdmin'){
                    this.$Message.error("平台管理员无需申请转正");
                    return false;
                }

             /*   if(this.user.hasMember === '1'){
                    this.$Message.error("已通过，无需申请转正");
                    return false;
                }

                if(this.user.hasLevel === '2'){
                    this.$Message.error("已离职，无法申请转正");
                    return false;
                }*/

                this.$refs['eachGeneralChild'].user = this.user;
                this.$refs['eachGeneralChild'].data = {};
                this.$refs['eachGeneralChild'].value = true;
            }
        },
        created(){
            searchTeacherBySelf().then(res=>{
                if(res.data.data){
                    this.user = res.data.data;
                }else{
                    this.user = this.$store.state.user.access.user;
                }
            })
        }
    }
</script>

<style scoped>

</style>